load("@io_bazel_rules_go//go:def.bzl", "go_library")
load("//bazel/go:go_test.bzl", "go_test")

go_library(
    name = "constellation",
    srcs = [
        "apply.go",
        "applyinit.go",
        "constellation.go",
        "helm.go",
        "kubernetes.go",
        "serviceaccount.go",
    ],
    importpath = "github.com/edgelesssys/constellation/v2/internal/constellation",
    visibility = ["//:__subpackages__"],
    deps = [
        "//bootstrapper/initproto",
        "//internal/atls",
        "//internal/attestation/variant",
        "//internal/cloud/azureshared",
        "//internal/cloud/cloudprovider",
        "//internal/cloud/gcpshared",
        "//internal/cloud/openstack",
        "//internal/config",
        "//internal/constants",
        "//internal/constellation/helm",
        "//internal/constellation/kubecmd",
        "//internal/constellation/state",
        "//internal/crypto",
        "//internal/file",
        "//internal/grpc/dialer",
        "//internal/grpc/grpclog",
        "//internal/grpc/retry",
        "//internal/kms/uri",
        "//internal/license",
        "//internal/retry",
        "//internal/semver",
        "//internal/versions",
        "@io_k8s_apiextensions_apiserver//pkg/apis/apiextensions/v1:apiextensions",
        "@io_k8s_apimachinery//pkg/api/errors",
        "@io_k8s_apimachinery//pkg/apis/meta/v1:meta",
        "@io_k8s_apimachinery//pkg/runtime/schema",
        "@io_k8s_apimachinery//pkg/types",
        "@io_k8s_client_go//dynamic",
        "@io_k8s_client_go//tools/clientcmd",
        "@org_golang_google_grpc//:grpc",
    ],
)

go_test(
    name = "constellation_test",
    srcs = [
        "apply_test.go",
        "applyinit_test.go",
    ],
    embed = [":constellation"],
    deps = [
        "//bootstrapper/initproto",
        "//internal/atls",
        "//internal/attestation/measurements",
        "//internal/attestation/variant",
        "//internal/cloud/cloudprovider",
        "//internal/config",
        "//internal/constants",
        "//internal/constellation/state",
        "//internal/crypto",
        "//internal/grpc/atlscredentials",
        "//internal/grpc/dialer",
        "//internal/grpc/testdialer",
        "//internal/kms/uri",
        "//internal/license",
        "//internal/logger",
        "@com_github_stretchr_testify//assert",
        "@com_github_stretchr_testify//require",
        "@io_k8s_client_go//tools/clientcmd",
        "@io_k8s_client_go//tools/clientcmd/api",
        "@org_golang_google_grpc//:grpc",
    ],
)
